package org.tio.sitexxx.service.service.qj;

import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.SqlPara;
import org.tio.sitexxx.service.model.main.Dialogue;
import org.tio.sitexxx.service.vo.Const;

import java.util.List;

public class DialogueService {
    public static final DialogueService me  = new DialogueService();
    public static final Dialogue dao = new Dialogue().dao();


    public List<Dialogue> findOne(Kv kv){
        SqlPara sqlPara =   Db.use(Const.Db.TIO_SITE_MAIN).getSqlPara("dialogue.findOne",kv);
        return dao.find(sqlPara);
    }


    public List<Dialogue> findAll(Kv kv){
        SqlPara sqlPara =   Db.use(Const.Db.TIO_SITE_MAIN).getSqlPara("dialogue.findAll",kv);
        return dao.find(sqlPara);
    }

    public void update(Dialogue dialogue){
        dialogue.update();
    }

    public void insert(Dialogue dialogue){
        dialogue.save();
    }
}
